﻿using Asp.Versioning;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;

namespace Himp.TaskScheduling.V1
{
    [Area(TaskSchedulingRemoteServiceConsts.ModuleName)]
    [RemoteService(Name = TaskSchedulingRemoteServiceConsts.RemoteServiceName)]
    [Route("api/taskScheduling/bizflowNode")]
    [ApiVersion("1.0")]
    [ApiController]
    [ControllerName("bizflowNode")]
    public class BizflowNodeController : TaskSchedulingController, IBizflowNodeService
    {
        private IBizflowNodeService _bizflowNodeService;

        public BizflowNodeController(IBizflowNodeService bizflowNodeService)
        {
            _bizflowNodeService = bizflowNodeService;
        }

        [HttpPost]
        public async Task<BizflowNodeDto> CreateAsync(BizflowNodeCreateDto input)
        {
            return await _bizflowNodeService.CreateAsync(input);
        }

        [HttpDelete]
        public async Task DeleteAsync(Guid id)
        {
            await _bizflowNodeService.DeleteAsync(id);
        }

        [HttpGet]
        public async Task<BizflowNodeDto> GetAsync(Guid id)
        {
            return await _bizflowNodeService.GetAsync(id);
        }

        [HttpGet]
        [Route("list")]
        public async Task<PagedResultDto<BizflowNodeDto>> GetListAsync([FromQuery]BizflowNodeInput input)
        {
            return await _bizflowNodeService.GetListAsync(input);
        }

        [HttpPut]
        public async Task<BizflowNodeDto> UpdateAsync(Guid id, BizflowNodeUpdateDto input)
        {
            return await _bizflowNodeService.UpdateAsync(id, input);
        }
    }
}
